<template>
  <div class="index-pages">
    <div class="banner-box">
      <div class="banner-content">
        <div
          class="banner"
          :class="`p-${i}`"
          v-for="i in 15"
          :key="i"
          :style="getStyle(i)"
          @click="handleTo(i)"
        >
          <img :src="`./images/banner-${i}.png`" class="banner-img" />
        </div>
      </div>
    </div>
    <div class="column-1-box">
      <div class="main-box">
        <div class="box-lf">
          <div class="title">AI实验助手<br />轻松学习</div>
          <div class="menu-list">
            <div
              class="item"
              v-for="(value, index) in menuList"
              :key="value.title"
              :class="{ active: activeIndex == index }"
              @mouseenter="switchMenu(index)"
            >
              <div class="title">{{ value.title }}</div>
              <div class="content" v-if="activeIndex == index">
                {{ value.content }}
              </div>
            </div>
          </div>
        </div>
        <div class="box-rt"></div>
      </div>
    </div>
    <div class="column-2-box">
      <div class="title">3D虚拟仿真实验</div>
      <div class="out-box">
        <div class="bg"></div>
        <div class="main-box">
          <div class="box-lf">
            <div class="lf-title">优势&特点</div>
            <div class="lf-sub-title">3D建模技术，沉浸式操作体验</div>
            <div class="menu-list">
              <div
                class="item"
                v-for="(value, index) in menuList2"
                :key="value.title"
                :class="{ active: activeIndex2 == index }"
                @mouseenter="switchMenu2(index)"
              >
                {{ value.title }}
              </div>
            </div>
          </div>
          <div class="box-rt" v-if="activeIndex2 == 0">
            <div class="rt-title">高精度仿真，还原真实实验场景</div>
            <div class="rt-content">
              物理引擎和AI算法相结合，模拟真实物理规律，使复杂实验的仿真准确率显著提升，并支持实时交互。AI可以实时解答学生在实验预习、操作和报告撰写过程中的疑问，确保学生在遇到问题时能够及时获得帮助，避免因问题积累而影响学习效果。
            </div>
            <div class="three">
              <div class="item">
                <div class="icon"></div>
                <div class="text">实时交互</div>
              </div>
              <div class="item">
                <div class="icon"></div>
                <div class="text">AI实时解答</div>
              </div>
              <div class="item">
                <div class="icon"></div>
                <div class="text">准确率提升</div>
              </div>
            </div>
            <!-- 待解决：这里可能有点击跳转事件 -->
            <div class="btn" @click="handleToLogin">了解详情</div>
          </div>
          <div class="box-rt" v-if="activeIndex2 == 1">
            <div class="rt-title">降低实验成本，提高资源利用率</div>
            <div class="rt-content">
              减少昂贵实验设备、耗材的损耗，解决高校实验设备不足问题，让更多学生获得实操机会。
            </div>
            <div class="three"></div>
            <div class="btn" @click="handleToLogin">了解详情</div>
          </div>
          <div class="box-rt" v-if="activeIndex2 == 2">
            <div class="rt-title">支持个性化学习与自适应训练</div>
            <div class="rt-content">
              支持教学或自学模式，适应不同学习阶段需求。<br />
              实时反馈操作错误，帮助学生针对性改进
            </div>
            <div class="three"></div>
            <div class="btn" @click="handleToLogin">了解详情</div>
          </div>
          <div class="box-rt" v-if="activeIndex2 == 3">
            <div class="rt-title">过程可溯，优化教学评估</div>
            <div class="rt-content">
              自动记录操作步骤，便于教师精准评估，帮助学生复盘错误操作
            </div>
            <div class="three"></div>
            <div class="btn" @click="handleToLogin">了解详情</div>
          </div>
        </div>
      </div>
    </div>
    <div class="column-3-box">
      <div class="column-3-title">平台优势</div>

      <img src="/images/column-3.png" class="column-img" alt="" />
    </div>
    <div class="column-4-box">
      <div class="column-title">合作院校</div>
      <div class="column-content">
        <div class="logo-img">
          <img src="/images/partner/北华大学.png" alt="">
        </div>
         <div class="logo-img">
          <img src="/images/partner/北京城市学院.png" alt="">
        </div>
         <div class="logo-img">
          
         
          <img src="/images/partner/河北工业大学.png" alt="">
          
        </div>
         <div class="logo-img">
          <img src="/images/partner/南开大学.png" alt="">
        </div>
         <div class="logo-img">
          <img src="/images/partner/石家庄职业技术学院.png" alt="">
        </div>
         <div class="logo-img">
          <img src="/images/partner/天津电子信息职业技术学院.png" alt="">
        </div>
         <div class="logo-img">
          <img src="/images/partner/天津工业大学.png" alt="">
        </div>
        <div class="logo-img">
          <img src="/images/partner/天津工业职业学院.png" alt="">
        </div>
        <div class="logo-img">
          <img src="/images/partner/天津科技大学.png" alt="">
        </div>
        <div class="logo-img">
          <img src="/images/partner/天津理工大学中环信息学院.png" alt="">
        </div>
        <div class="logo-img">
          <img src="/images/partner/天津师范大学.png" alt="">
        </div>
        <div class="logo-img">
           <img src="/images/partner/中国民航大学.png" alt="">
        </div>
      </div>
    </div>
  </div>
</template>
<script setup lang="ts">
import { ref, onMounted, onUnmounted } from "vue";
import { useRouter } from "vue-router";
const router = useRouter();

// 若需要右侧图片跟着切换，就在list里再价格img字段
const menuList = ref([
  {
    title: "精准的专业知识库",
    content: "深度整合学科理论、实验规程与安全规范，确保解答内容科学准确",
  },
  {
    title: "即时响应",
    content: "实时解答问题，减少等待时间，提升学习效率",
  },
  {
    title: "自适应学习支持",
    content:
      "根据用户身份（教师/学生）和水平调整回答深度；记录常见问题，智能预测并提前提示关键操作风险或易错点",
  },
  {
    title: "教育安全与合规性保障",
    content: "符合教育数据隐私标准，不存储敏感个人信息",
  },
]);
const activeIndex = ref(0);
const switchMenu = (index: number) => {
  activeIndex.value = index;
};
const activeIndex2 = ref(0);
const menuList2 = [
  { title: "虚拟仿真" },
  { title: "降本增效" },
  { title: "个性化学习" },
  { title: "教学评估" },
];
const switchMenu2 = (index: number) => {
  activeIndex2.value = index;
};

const handleTo = (i: number) => {
  // 实验仪器百科
  // if (i == 1) {
  //   router.push({
  //     path: "/wiki",
  //   });
  // }
  // if (i == 7) {
  //   router.push({
  //     path: "standard-experimental-library",
  //   });
  // }
  // // AI实验助手
  // if (i == 10) {
  //   router.push({
  //     path: "/ai",
  //   });
  // }
};
const handleToLogin = () => {
  router.push({
    path: "/login",
  });
};
const getStyle = (i: number) => {
  return {
    "--amplitude": `${5 + Math.random() * 5}px`,
    "--duration": `${5 + Math.random() * 3}s`,
    "--delay": `${i * 0.1}s`,
    "--rotate-deg": `${Math.random() > 0.5 ? 1 : -1}deg`,
  };
};
</script>
<style lang="less" scoped>
.index-pages {
  width: 100%;
  .banner-box {
    background: url(/images/banner-bg.png) no-repeat;
    background-size: 100% 100%;
    width: 1920px;
    margin-top: -90px;
    box-sizing: border-box;
    height: 1080px;
    padding-top: 90px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    &::after {
      position: absolute;
      top: 0;
      content: "";
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.4);
    }

    .banner-content {
      position: relative;
      height: 590px;
      box-sizing: border-box;
      width: 1513px;
      z-index: 99;
      .banner {
        position: absolute;
        z-index: 1;
        cursor: pointer;
        animation: float var(--duration) ease-in-out infinite var(--delay);
        @keyframes float {
          0%,
          100% {
            transform: translateY(0) rotate(0deg);
          }
          50% {
            transform: translateY(calc(-1 * var(--amplitude)))
              rotate(var(--rotate-deg));
          }
        }
        &.p-1 {
          left: 225px;
          top: 5px;
          z-index: 2;
          width: 256px;
          height: 187px;
        }
        &.p-2 {
          left: 528px;
          top: 71px;
          width: 162px;
          height: 105px;
        }
        &.p-3 {
          left: 727px;
          top: 102px;
          z-index: 6;
          width: 149px;
          height: 90px;
        }
        &.p-4 {
          left: 899px;
          top: 0px;
          width: 228px;
          height: 260px;
        }
        &.p-5 {
          left: 0px;
          top: 225px;
          width: 396px;
          height: 203px;
        }
        &.p-6 {
          left: 323px;
          top: 198px;
          z-index: 3;
          width: 188px;
          height: 128px;
        }
        &.p-7 {
          left: 545px;
          top: 185px;
          z-index: 5;
          width: 297px;
          height: 232px;
        }
        &.p-8 {
          left: 847px;
          top: 237px;
          z-index: 2;
          width: 229px;
          height: 105px;
        }
        &.p-9 {
          left: 1117px;
          top: 132px;
          z-index: 3;
          width: 396px;
          height: 203px;
        }
        &.p-10 {
          left: 141px;
          top: 367px;
          z-index: 2;
          width: 276px;
          height: 222px;
        }
        &.p-11 {
          left: 377px;
          top: 330px;
          z-index: 4;
          width: 224px;
          height: 112px;
        }
        &.p-12 {
          left: 536px;
          top: 414px;
          z-index: 5;
          width: 161px;
          height: 95px;
        }
        &.p-13 {
          left: 738px;
          top: 363px;
          width: 189px;
          height: 146px;
        }
        &.p-14 {
          left: 1055px;
          top: 317px;
          width: 276px;
          height: 222px;
          z-index: 2;
        }
        &.p-15 {
          left: 950px;
          top: 437px;
          width: 228px;
          height: 152px;
        }
        .banner-img {
          width: 100%;
          height: 100%;
          transition: all 0.7s;
        }

        &:hover {
          z-index: 101;
          .banner-img {
            transform: scale(1.15);
          }
        }
      }
    }
  }
  .column-img {
    width: 1920px;
    vertical-align: top;
  }
  .column-1-box {
    width: 1920px;
    height: 910px;
    box-sizing: border-box;
    background: #ffffff;
    padding: 140px 200px 0px 200px;
    .main-box {
      width: 1520px;
      height: 630px;
      display: flex;
      justify-content: space-between;
      .box-lf {
        width: 370px;
        padding-top: 50px;
        .title {
          font-family: PingFangSC, PingFang SC;
          font-weight: 600;
          font-size: 50px;
          color: #000000;
          line-height: 60px;
          text-align: left;
          font-style: normal;
        }
        .menu-list {
          margin-top: 40px;
          .item {
            width: 370px;
            height: 70px;
            background: #f6f7f9;
            border-radius: 8px;
            line-height: 70px;
            cursor: pointer;
            margin-bottom: 12px;
            box-sizing: border-box;
            .title {
              line-height: 70px;
              font-family: PingFangSC, PingFang SC;
              font-weight: 500;
              font-size: 16px;
              color: #262626;
              text-align: left;
              font-style: normal;
              position: relative;
              padding-left: 40px;
              &::before {
                content: "";
                position: absolute;
                width: 6px;
                height: 6px;
                border-radius: 3px;
                background-color: #262626;
                left: 24px;
                top: 32px;
              }
            }
            &.active {
              background-color: #fff;
              border-radius: 8px;
              border: 1px solid #e6ebf1;
              padding: 24px 24px 24px 40px;
              height: 122px;
              .title {
                padding: 0;
                line-height: 22px;
                height: 22px;
                &::before {
                  left: -16px;
                  top: 8px;
                }
              }
              .content {
                margin-top: 12px;
                font-family: PingFangSC, PingFang SC;
                font-weight: 400;
                font-size: 14px;
                color: #8c8c8c;
                line-height: 20px;
                text-align: left;
                font-style: normal;
              }
            }
          }
        }
      }
      .box-rt {
        width: 1070px;
        height: 630px;
        background: url("@/assets/home/img-1.png") no-repeat;
        background-size: 100% 100%;
      }
    }
  }
  .column-2-box {
    width: 1920px;
    height: 1060px;
    background: #f3f7fb;
    box-sizing: border-box;
    .title {
      font-family: PingFangSC, PingFang SC;
      font-weight: 600;
      font-size: 50px;
      color: #000000;
      line-height: 70px;
      text-align: left;
      font-style: normal;
      padding: 140px 0 90px 200px;
      background: #f3f7fb;
    }
    .out-box {
      position: relative;
      height: 615px;
      .bg {
        // 待解决：这里需要改用背景图片
        position: absolute;
        left: 0;
        top: 0;
        width: 1530px;
        height: 615px;
        background: linear-gradient(270deg, #72b7fa 0%, #1a5bdf 100%);
      }
    }
    .main-box {
      position: absolute;
      left: 200px;
      top: 0;
      width: 1520px;
      height: 615px;
      display: flex;
      justify-content: space-between;
      padding-top: 102px;
      .box-lf {
        width: 242px;
        padding-top: 20px;
        .lf-title {
          height: 42px;
          font-family: PingFangSC, PingFang SC;
          font-weight: 600;
          font-size: 30px;
          color: #ffffff;
          line-height: 42px;
          text-align: left;
          font-style: normal;
        }
        .lf-sub-title {
          height: 22px;
          font-family: PingFangSC, PingFang SC;
          font-weight: 400;
          font-size: 16px;
          color: #ffffff;
          line-height: 22px;
          text-align: left;
          font-style: normal;
          margin-top: 8px;
        }
        .menu-list {
          margin-top: 48px;
          .item {
            width: 242px;
            height: 56px;
            box-shadow: inset 1px 0px 0px 0px rgba(255, 255, 255, 0.3);
            box-sizing: border-box;
            font-family: PingFangSC, PingFang SC;
            font-weight: 400;
            font-size: 18px;
            color: #ffffff;
            line-height: 56px;
            text-align: left;
            font-style: normal;
            padding-left: 26px;
            cursor: pointer;
            &.active {
              width: 242px;
              height: 56px;
              background: rgba(255, 255, 255, 0.1);
              box-shadow: inset 2px 0px 0px 0px #ffffff;
            }
          }
        }
      }
      .box-rt {
        box-sizing: border-box;
        width: 1174px;
        height: 400px;
        background: linear-gradient(90deg, #f5faff 0%, #ffffff 100%);
        box-shadow: 0px 12px 12px 0px rgba(20, 55, 125, 0.05);
        border-radius: 12px;
        padding: 50px 50px 0 50px;
        .rt-title {
          height: 33px;
          font-family: PingFangSC, PingFang SC;
          font-weight: 500;
          font-size: 24px;
          color: #262626;
          line-height: 33px;
          text-align: left;
          font-style: normal;
        }
        .rt-content {
          margin-top: 20px;
          height: 75px;
          font-family: PingFangSC, PingFang SC;
          font-weight: 400;
          font-size: 18px;
          color: #595959;
          line-height: 25px;
          text-align: left;
          font-style: normal;
          padding-right: 235px;
          box-sizing: border-box;
        }
        .three {
          width: 100%;
          height: 119px;
          border-bottom: 1px solid #e6ebf1;
          padding-top: 57px;
          display: flex;
          box-sizing: border-box;
          .item {
            margin-right: 50px;
            display: flex;
            align-items: center;
            .icon {
              width: 24px;
              height: 20px;
              background: url(@/assets/check-images.png) no-repeat;
            }
            .text {
              margin-left: 14px;
              font-family: PingFangSC, PingFang SC;
              font-weight: 400;
              font-size: 18px;
              color: #5a5a5a;
              line-height: 25px;
              text-align: left;
              font-style: normal;
            }
          }
        }
        .btn {
          // 待解决：btn 里有个图标，切图拿不到
          width: 190px;
          height: 44px;
          background: #1165ed;
          border-radius: 4px;
          margin-top: 30px;
          font-family: PingFangSC, PingFang SC;
          font-weight: 400;
          font-size: 16px;
          color: #ffffff;
          line-height: 44px;
          text-align: left;
          font-style: normal;
          text-align: center;
          cursor: pointer;
        }
      }
    }
  }
  .column-3-box {
    width: 1920px;
    box-sizing: border-box;
    background: #cfcfcf;
    position: relative;
    .column-3-title {
      position: absolute;
      left: 150px;
      top: 125px;
      padding-left:50px;
      padding-top:20px;
      background: #fff;
      width: 600px;
      height: 80px;
      font-family: PingFangSC, PingFang SC;
      font-weight: 600;
      font-size: 50px;
      color: #000000;
      line-height: 70px;
      text-align: left;
      font-style: normal;
    }
  }
  .column-4-box {
    width: 1920px;
    padding-top: 110px;
    box-sizing: border-box;
    height: 630px;
    background: #f4f4f4;
  }
  .column-title {
    font-family: PingFangSC, PingFang SC;
    font-weight: 500;
    font-size: 32px;
    color: #262626;
    line-height: 45px;
    text-align: center;
    font-style: normal;
    margin-bottom: 54px;
  }
  .column-content{
    width:100%;
    display:flex;
    flex-wrap: wrap;
    padding:0 25px;
    justify-content: center;
    .logo-img{
      height:90px;
      border-radius: 4px;
      overflow: hidden;
      background: #fff;
      margin:0 16px 16px 0;
      img{
        height:90px;
      }
    }

  }
}
</style>
